package dao

import (
	"go-ocr/db"
	"go-ocr/db/model"
)

const dataItemInfoTable = "dataiteminfo"

func (c DataItemInfoInterfaceImp) DataItem(dataItemNumber string) (model.DataItemInfo, error) {
	var err error
	var dataItemInfo = model.DataItemInfo{}

	cli := db.Get()
	err = cli.Table(dataItemInfoTable).Where("data_number = ?", dataItemNumber).Where("device_number = 9999").Limit(1).Find(&dataItemInfo).Error

	return dataItemInfo, err
}
